<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--物料到货表,选到项目,入库库房-->
    <!--到货单详细导入,删除按钮边上加上导入到货详细-->
    <title>物料验收单</title>
    <link rel="stylesheet" type="text/css" href="/static/jquery-easyui-1.3.3/themes/default/easyui.css"></link>
    <link rel="stylesheet" type="text/css" href="/static/jquery-easyui-1.3.3/themes/icon.css"></link>
    <script type="text/javascript" src="/static/jquery-easyui-1.3.3/jquery.min.js"></script>
    <script type="text/javascript" src="/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/static/js/date.js"></script>
    <script type="text/javascript">

        var url;
        $(function () {
            $(document).bind('contextmenu', function (e) {
                e.preventDefault();
                $('#tree-0').menu('show', {
                    left: e.pageX,
                    top: e.pageY
                });
            });
        });

        //加载项目tree类别
        function openProjListChoose() {
            $("#projList").dialog("open").dialog("setTitle", "进入项目选择");
            $("#projTree").tree({
                url: '/admin/project/loadProjectTree',
                onLoadSuccess: function (node, data) {
                    $("#projTree").tree('expandAll');
                },
                onDblClick: function (node) {

                },
                //右键选择树形菜单操作
                onContextMenu: function (e, node) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
                //单击某类别 展示不同详细和按钮选择
                onClick: function (node) {
                    if (node.attributes.state == 2) { // 假如是二级菜单,可以删除
                        $("#projNameList").datagrid('load', {
                            "w_id": node.id
                        });
                    } else if (node.attributes.state == 1) {
                        $("#projNameList").datagrid('load', {
                            "o_id": node.id
                        });
                    }
                }
            });
            loadDataGrid();
        }

        //加载项目数据表格
        function loadDataGrid() {
            $("#projNameList").datagrid({
                //双击事件
                onDblClickRow: function (index, row) {
                    $("#projId").val(row.id);
                    $("#projName").val(row.xiangmumingcheng);
                    $("#projList").dialog("close");
                },
                onRowContextMenu: function (e, rowIndex, rowData) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
            });
        }

        //加载项目tree类别
        function openDeptListChoose() {
            $("#deptList").dialog("open").dialog("setTitle", "选择发料单位");
            $("#deptTree").tree({
                url: '/admin/bumen/loadBumenTree',
                onLoadSuccess: function (node, data) {
                    $("#deptTree").tree('expandAll');
                },
                onDblClick: function (node) {

                },
                //右键选择树形菜单操作
                onContextMenu: function (e, node) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
                //单击某类别 展示不同详细和按钮选择
                onClick: function (node) {
                    if (node.attributes.state == 2) { // 假如是二级菜单,可以删除
                        $("#deptNameList").datagrid('load', {
                            "w_id": node.id
                        });
                    } else if (node.attributes.state == 1) {
                        $("#deptNameList").datagrid('load', {
                            "o_id": node.id
                        });
                    }
                }
            });
            loadDeptDataGrid();
        }

        //加载部门数据表格
        function loadDeptDataGrid() {
            $("#deptNameList").datagrid({
                //双击事件
                onDblClickRow: function (index, row) {
                    $("#deptId").val(row.id);
                    $("#deptName").val(row.bumenmingcheng);
                    $("#deptList").dialog("close");
                },
                onRowContextMenu: function (e, rowIndex, rowData) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
            });
        }

        //加载库房tree类别
        function openStoreListChoose() {
            $("#storeList").dialog("open").dialog("setTitle", "进入仓库选择");
            $("#storeTree").tree({
                url: '/admin/kufang/loadKufangTree',
                onLoadSuccess: function (node, data) {
                    $("#storeTree").tree('expandAll');
                },
                onDblClick: function (node) {

                },
                //右键选择树形菜单操作
                onContextMenu: function (e, node) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
                //单击某类别 展示不同详细和按钮选择
                onClick: function (node) {
                    if (node.attributes.state == 2) { // 假如是二级菜单,可以删除
                        $("#storeNameList").datagrid('load', {
                            "w_id": node.id
                        });
                    } else if (node.attributes.state == 1) {
                        $("#storeNameList").datagrid('load', {
                            "o_id": node.id
                        });
                    }
                }
            });
            loadKuDataGrid();
        }

        //加载库房数据表格
        function loadKuDataGrid() {
            $("#storeNameList").datagrid({
                //双击事件
                onDblClickRow: function (index, row) {
                    $("#storeId").val(row.id);
                    $("#storeName").val(row.kufangmingcheng);
                    $("#storeList").dialog("close");
                },
                onRowContextMenu: function (e, rowIndex, rowData) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                },
            });
        }

        // 查询项目
        // function searchProj() {
        //     $("#projNameList").datagrid('load', {
        //         "codeOrProjName": $("#s_codeOrProjName").val()
        //     })
        // }

        // 查询部门
        function searchDept() {
            $("#deptNameList").datagrid('load', {
                "bumenmingcheng": $("#deptSearch").val()
            })
        }

        //查询库房
        function searchStore() {
            $("#storeNameList").datagrid('load', {
                "kufangmingcheng": $("#storeSearch").val()
            })
        }

        //保存项目选择
        function saveProjChoose() {
            var node = $('#projTree').tree('getSelected'); // 获取选中节点
            $("#projId").val(node.id);
            $("#projName").val(node.text);
            $("#projList").dialog("close");
        }

        //保存部门选择 条目->文本
        function saveDeptChoose() {
            var node = $('#deptTree').tree('getSelected'); // 获取选中节点
            $("#deptId").val(node.id);
            $("#deptName").val(node.text);
            $("#deptList").dialog("close");
        }

        //保存库房选择
        function saveStoreChoose() {
            var node = $('#storeTree').tree('getSelected');
            $("#storeId").val(node.id);
            $("#storeName").val(node.text);
            $("#storeList").dialog("close");
        }

        function searchBindDaohuoDan() {
            $("#daohuoList").datagrid('load', {
                "wuliaodaohuodanhao": $("#dh_danhao").val(),
                "xiangmumingcheng": $("#dh_xiangmuming").val(),
                "rukukufang": $("#dh_kufang").val(),
                "beizhu": $("#dh_beizhu").val()
            });
        }

        // 验收详细添加操作,已被弃用
        function openYanshouDetailsAddDialog() {
            $("#dlg").dialog("open").dialog("setTitle", "物料选择");
            $("#yingshoushuliang").removeAttr("readonly");
            $("#tree").tree({
                url: '/admin/wuliaoTree/loadWuliaoTree',
                onLoadSuccess: function (node, data) {
                    var rootNode = $("#tree").tree('getRoot');
                    $("#tree").tree('expand', rootNode.target);
                },
                //单击某类别 展示不同详细和按钮选择
                onClick: function (node) {
                    if (node.attributes.state == 2) { // 假如是二级菜单,可以删除
                        $("#dg3").datagrid('load', {
                            "w_id": node.id
                        });
                    } else if (node.attributes.state == 1) {
                        $("#dg3").datagrid('load', {
                            "o_id": node.id
                        });
                    }
                }
            });
        }

        function openYanshouDetailsModifyDialog() {
            $("#saveAndAddNextBuuton").hide();
            var selectedRows = $("#dg").datagrid("getSelections");
            if (selectedRows.length != 1) {
                $.messager.alert("系统提示", "请选择一个物料！");
                return;
            }
            var row = selectedRows[0];
            $("#dlg4").dialog("open").dialog("setTitle", "修改验收单物料");
            ifUpdateYanshouDetails(row);
            $("#fm4").form("load", row);
            $("#action").val("modify");
            $("#rowIndex").val($("#dg").datagrid("getRowIndex", row));
        }

        function deleteYanshouDetails() {
            var selectedRows = $("#dg").datagrid("getSelections");
            if (selectedRows.length != 1) {
                $.messager.alert("系统提示", "请选择要删除的物料！");
                return;
            }
            $.messager.confirm("系统提示", "您确定要删除这个物料吗？", function (r) {
                if (r) {
                    $('#dg').datagrid('deleteRow', $("#dg").datagrid("getRowIndex", selectedRows[0]));
                    // setPurchaseListAmount();
                }
            });
        }

        function setPurchaseListAmount() {
            var rows = $("#dg").datagrid("getRows");
            var amount = 0;
            for (var i = 0; i < rows.length; i++) {
                var row = rows[i];
                amount += row.total;
            }
            $("#amountPayable").val(amount.toFixed(2));
            $("#amountPaid").val(amount.toFixed(2));
        }

        $(document).ready(function () {
            $("#daohuoshijian").datebox("setValue", genTodayStr()); // 设置上个月日期
            $("#yanshouriqi").datebox("setValue", genTodayStr()); // 设置当前日期

            $("#dh").load('/admin/yanshoudan/getYanshouNumber');

        });

        //保存验收单
        function saveYanshouDan() {
            var wuliaoYanshouDetailsJson = JSON.stringify($("#dg").datagrid("getData").rows);
            $("#wuliaoYanshouDetailsJson").val(wuliaoYanshouDetailsJson);
            $("#wuliaoyanshoudanhao").val($("#dh").text());
            if ($("#dg").datagrid("getRows").length == 0) {
                $.messager.alert("系统提示", "请添加验收物料!")
                return;
            }
            // else{
            // var datagrids = $("#dg").datagrid("getRows");
            // for (var i = datagrids.length - 1; i >= 0; i--) {
            //     if (undefined == datagrids[i].yingshoushuliang) {
            //         $.messager.alert("系统提示", "请填写应收数量!")
            //         return;
            //     }
            //     if (undefined == datagrids[i].danjia) {
            //         $.messager.alert("系统提示", "请填写单价!")
            //         return;
            //     }
            //     if (undefined == datagrids[i].zongjia) {
            //         $.messager.alert("系统提示", "请填写总价!")
            //         return;
            //     }
            // if (undefined == datagrids[i].shishoushuliang) {
            //     $.messager.alert("系统提示", "请填写实收数量!")
            //     var datagrids = $("#dg").datagrid("getRows");
            //     return;
            // }
            //     }
            // }
            if (!$("#fm6").form("validate")) {
                $.messager.alert("系统提示", "请填写必填项!");
                return;
            }
            // if (!$("#fm4").form("validate")) {
            //     $("#saveAndAddNextBuuton").hide();
            //     $("#dlg4").dialog("open").dialog("setTitle", "请填写应收数量!");
            //     var datagrids = $("#dg").datagrid("getRows");
            //     for (var i = datagrids.length - 1; i >= 0; i--) {
            //         if (undefined == datagrids[i].yingshoushuliang) {
            //              var row = datagrids[i];
            //             $.messager.alert("系统提示", "请填写应收数量!");
            //              break;
            //         }
            //     }
            //     // $("#number").removeAttr("readonly");
            //     // $("#jiaohuodidian").removeAttr("readonly");
            //     // $("#zhiliangyaoqiu").removeAttr("readonly");
            //     // $("#xuqiuriqi").removeAttr("readonly");
            //     $("#fm4").form("load", row);
            //
            //     $("#action").val("modify");
            //     $("#rowIndex").val($("#dg").datagrid("getRowIndex", row));
            //     return;
            // }
            $.ajax({
                url: "/admin/yanshoudan/save",
                data: $("#fm6").serialize(),
                type: 'post',
                dataType: 'json',
                success: function (result) {
                    if (result.success) {
                        $.messager.confirm("系统提示", result.msg, function (r) {
                            window.location.reload();
                        })
                    } else {
                        $.messager.alert("系统提示", result.errorInfo);
                    }
                }
            });
        }

        //  物料类别模块管理
        function openGoodsTypeAddDialog() {
            $("#dlg2").dialog("open").dialog("setTitle", "新增物料类别");
        }

        function deleteGoodsType() {
            var node = $('#tree').tree('getSelected'); // 获取选中节点
            var id = node.id;
            $.post("/admin/goodsType/delete", {id: id}, function (result) {
                if (result.success) {
                    $('#tree').tree('reload');
                } else {
                    $.messager.alert("系统提示", "提交失败，请联系管理员！");
                }
                $('#del').linkbutton('disable');
            }, "json");
        }

        function saveGoodsType() {
            var goodsTypeName = $("#goodsTypeName").val();
            if (!$("#fm").form("validate")) {
                return;
            }
            var node = $('#tree').tree('getSelected'); // 获取选中节点
            var parentId; // 父节点Id
            if (node == null) {
                parentId = 1;
            } else {
                parentId = node.id;
            }
            $.post("/admin/goodsType/save", {name: goodsTypeName, parentId: parentId}, function (result) {
                if (result.success) {
                    $('#tree').tree('reload');
                    closeGoodsTypeDialog();
                } else {
                    $.messager.alert("系统提示", "提交失败，请联系管理员！");
                }
            }, "json");
        }

        function closeGoodsTypeDialog() {
            $("#dlg2").dialog("close");
            $("#goodsTypeName").val("");
        }

        function searchGoods() {
            $("#dg3").datagrid('load', {
                "codeOrName": $("#s_codeOrName").val()
            });
        }

        function closeGoodsDialog() {
            $("#s_codeOrName").val("");
            $("#dlg").dialog("close");
        }

        //物料选择 物料具体数据填充
        function openGoodsChooseDialog() {
            $("#saveAndAddNextBuuton").show();
            var selectedRows = $("#dg3").datagrid("getSelections");
            if (selectedRows.length != 1) {
                $.messager.alert("系统提示", "请选择一个物料！");
                return;
            }
            var row = selectedRows[0];
            $("#dlg4").dialog("open").dialog("setTitle", "选择物料");
            $("#fm4").form("load", row);
            $("#action").val("add");
        }

        function closeGoodsChooseDialog() {
            $("#dlg4").dialog("close");
            resetValue();
        }

        function resetValue() {
            $("#num").numberbox("setValue", "");
            $("#price").val("");
        }

        //添加导入到货明细
        function addGoodsDetailList() {

        }

        //选中明细数据绑定对应申购单id
        function bangShenGouId() {

        }

        //获取到货单数据绑定到验收单中
        function getDaoHuoData() {
            var xiangmumingcheng = $("#projName").val();
            if (xiangmumingcheng) {
                $("#daohuoList").datagrid('load', {
                    "xiangmumingcheng": xiangmumingcheng
                });
                $("#daohuodan").dialog("open").dialog("setTitle", "关联到货单");
            } else {
                $.messager.alert("系统提示", "请首先选择项目！");
            }
        }

        //获取到货单stuff 根据单个id
        function getDaohuoStuffId(id, index, wuliaodaohuodanhao) {
            console.log("getDaohuoStuffId:" + id + " index:" + index + " wuliaodaohuodanhao:" + wuliaodaohuodanhao);
            $.ajax({
                url: '/admin/daohuodan/bangdingDaohuo',
                data: {'id': id},
                dataType: 'json',
                type: 'post',
                success: function (result) {
                    if (result.success) {
                        // alert(result.shengouZong)
                        for (var i = 0; i < result.daohuoDetailsList.length; i++) {
                            // $('#dg').datagrid('appendRow',
                            $('#dg').datagrid('insertRow', {
                                index: index,
                                row: {
                                    id: result.daohuoDetailsList[i].id,
                                    wuliaobianma: result.daohuoDetailsList[i].wuliaobianma,
                                    duiyingdaohuodanhao: wuliaodaohuodanhao,
                                    mingchengguige: result.daohuoDetailsList[i].mingchengguige,
                                    danwei: result.daohuoDetailsList[i].danwei,
                                    yingshoushuliang: result.daohuoDetailsList[i].daohuoshuliang,
                                    shishoushuliang: result.daohuoDetailsList[i].daohuoshuliang,
                                    beizhu: result.daohuoDetailsList[i].beizhu,
                                    createtime: result.daohuoDetailsList[i].createtime,
                                    zongzhangid: result.daohuoDetailsList[i].zongzhangid
                                }
                            });
                        }
                        // alert(result.shengouDetailsList)
                    }
                }
            })
        }

        // var untilWriteFlag = 1;
        function ifUpdateYanshouDetails(row) {
            // $("#daohuoshuliang").numberbox("setValue", row.daohuoshuliang);
            // $("#daohuoshijian").datebox("setValue", genTodayStr()); // 设置当前日期
            if ($("#beizhu_dh").val().length == 0) {
                $("#beizhu_dh").val(row.beizhu);
            }
            if (row.duiyingdaohuodanhao == undefined || row.duiyingdaohuodanhao == '') {
                console.log("yingshoushuliang is undefined,change the input can write");
                $("#yingshoushuliang").removeAttr("readonly");
                // untilWriteFlag = 0;
            }
            if (!(row.duiyingdaohuodanhao == undefined || row.duiyingdaohuodanhao == '')) {
                console.log("yingshoushuliang is there,so make the input readonly")
                if (!($("#yingshoushuliang").attr("readonly") == true)) {
                    console.log("yingshoushuliang readonly true")
                    $("#yingshoushuliang").attr("readonly", "readonly");
                }
            }
            $("#yingshoushuliang").focus();
        }

        function saveGoods(type) {
            var action = $("#action").val();
            if (!$("#fm5").form("validate")) {
                return;
            }
            if (!$("#fm4").form("validate")) {
                return;
            }
            if (action == "add") {
                console.log("add```")
                var selectedRows = $("#dg3").datagrid("getSelections");
                var row = selectedRows[0];
                var yingshoushuliang = $("#yingshoushuliang").numberbox("getValue");
                var shishoushuliang = $("#shishoushuliang").numberbox("getValue");
                var danjia = $("#danjia").numberbox("getValue") == null ? null : $("#danjia").numberbox("getValue");
                var zongjia = null;
                if (danjia == null) {
                    zongjia = null;
                } else {
                    zongjia = danjia * shishoushuliang;
                }
                // $("#createtime").datebox("setValue", genTodayStr());
                // var createtime =  $("#createtime").datebox("getValue");
                $('#dg').datagrid('appendRow', {
                    duiyingdaohuodanhao: row.duiyingdaohuodanhao,
                    wuliaobianma: row.wuliaobianma,
                    mingchengguige: row.mingchengguige,
                    danwei: row.danwei,
                    yingshoushuliang: yingshoushuliang,
                    shishoushuliang: shishoushuliang,
                    danjia: danjia,
                    zongjia: zongjia,
                    beizhu: row.beizhu,
                    // createtime:createtime,
                    zongzhangid: row.zongzhangid
                });
            } else if (action == "modify") {
                var rowIndex = $("#rowIndex").val();
                var selectedRows = $("#dg").datagrid("getSelections");
                var row = selectedRows[0];
                var yingshoushuliang = $("#yingshoushuliang").numberbox("getValue");
                var shishoushuliang = $("#shishoushuliang").numberbox("getValue");
                var danjia = $("#danjia").numberbox("getValue") == null ? null : $("#danjia").numberbox("getValue");
                var zongjia = null;
                if (danjia == null) {
                    zongjia = null;
                } else {
                    zongjia = danjia * shishoushuliang;
                }
                var danhaoduiying;
                if (row.duiyingdaohuodanhao == undefined) {
                    danhaoduiying = '';
                } else {
                    danhaoduiying = row.duiyingdaohuodanhao;
                }
                // $("#createtime").datebox("setValue", genTodayStr()); // 设置上个月日期
                // var createtime =  $("#createtime").datebox("getValue");
                $('#dg').datagrid('updateRow', {
                    index: rowIndex,
                    row: {
                        duiyingdaohuodanhao: danhaoduiying,
                        wuliaobianma: row.wuliaobianma,
                        mingchengguige: row.mingchengguige,
                        danwei: row.danwei,
                        yingshoushuliang: yingshoushuliang,
                        shishoushuliang: shishoushuliang,
                        danjia: danjia,
                        zongjia: zongjia,
                        beizhu: row.beizhu,
                        zongzhangid: row.zongzhangid
                    }
                });
            }
            setPurchaseListAmount();
            if (type == 1) {
                closeGoodsDialog();
            }
            closeGoodsChooseDialog();
        }

        //一开始的加载事件
        $(function () {
            //详细的列表datagrid
            $("#dg").datagrid({
                onClickRow: function (index, row) {
                    // $("#dg").datagrid('selectRow', index);
                    // $("#dg").datagrid('beginEdit', index);//设置可编辑状态
                },
                //双击事件
                onDblClickRow: function (index, row) {
                    ifUpdateYanshouDetails(row);
                    $("#saveAndAddNextBuuton").hide();
                    $("#dlg4").dialog("open").dialog("setTitle", "修改验收单数据");

                    // $("#number").removeAttr("readonly");
                    // $("#jiaohuodidian").removeAttr("readonly");
                    // $("#zhiliangyaoqiu").removeAttr("readonly");
                    // $("#xuqiuriqi").removeAttr("readonly");
                    $("#fm4").form("load", row);

                    $("#action").val("modify");
                    $("#rowIndex").val($("#dg").datagrid("getRowIndex", row));
                },
                onRowContextMenu: function (e, rowIndex, rowData) { //右键时触发事件                      
                    e.preventDefault(); //阻止浏览器捕获右键事件
                    $(this).datagrid("clearSelections"); //取消所有选中项
                    $(this).datagrid("selectRow", rowIndex); //根据索引选中该行
                    $('#grid-data').menu('show', {
                        left: e.pageX,//在鼠标点击处显示菜单
                        top: e.pageY
                    });
                    e.preventDefault();  //阻止浏览器自带的右键菜单弹出
                },
            });

            $("#dg3").datagrid({
                //双击事件
                onDblClickRow: function (index, row) {
                    openGoodsChooseDialog();
                    // $("#dlg4").dialog("open").dialog("setTitle","选择物料");
                    // $("#fm4").form("load",row);
                    // $("#lastPurchasingPrice").val("￥"+row.lastPurchasingPrice);
                    // $("#price").numberbox("setValue",row.lastPurchasingPrice);
                    // $("#num").focus();
                }
            });

            $("#daohuoList").datagrid({
                //申购单的单击事件
                onClickRow: function (index, row) {
                    // var isCheckIndex = $("input[type='checkbox']").eq(index).is(':checked');
                    // checkEachBox();
                    // if (isCheckIndex) {
                    //     console.log("isCheckIndex is true");
                    //     $('#dg').datagrid("deleteRow", index);
                    // } else {
                    //
                    //     getShengouStuffId(row.id);
                    // }

                },
                //的那几申购list,触发insertRow,点击第二个,先将新row的id进行新增
                onSelect: function (index, row) {
                    // var allShengouSelect = $("#shengouList").datagrid("getSelections");
                    getDaohuoStuffId(row.id, index, row.wuliaodaohuodanhao);
                },
                onUnselect: function (index, row) {
                    console.log("onUnselect row.id:" + row.id + " index:" + index);
                    // var allShengouSelect = $("#shengouList").datagrid("getSelections");
                    // var index = $("#dg").datagrid("getRowIndex",row);
                    var dgMainAll = $("#dg").datagrid("getRows");
                    // console.log("dgMainAll:"+dgMainAll.length)
                    for (var j = dgMainAll.length - 1; j >= 0; j--) {
                        // console.log("dgMainAll[j].zongzhangid:"+dgMainAll[j].zongzhangid+",row.id:"+row.id)
                        if (dgMainAll[j].zongzhangid == row.id) {
                            var thisindex = $("#dg").datagrid("getRowIndex", dgMainAll[j]);
                            console.log("thisindex:" + thisindex)
                            $('#dg').datagrid("deleteRow", thisindex);
                        }
                    }
                },
                onCheckAll: function (index, row) {
                    $('#dg').datagrid('loadData', {total: 0, rows: []});
                    var allDaohuoRows = $("#daohuoList").datagrid("getRows");
                    // $("input[type='checkbox']").each(function () {
                    //     if ($(this).attr('checked') == true) {
                    //         $(this).attr('checked') == false;
                    //         // testalert();
                    //     }
                    // });

                    for (var i = 0; i < allDaohuoRows.length; i++) {
                        getDaohuoStuffId(allDaohuoRows[i].id, i, allDaohuoRows[i].wuliaodaohuodanhao);
                    }
                    // var allShengouSelect = $("#shengouList").datagrid("getSelections");

                },
                onUnselectAll: function (index, row) {
                    $('#dg').datagrid('loadData', {total: 0, rows: []})
                },
                //申购单的双击事件
                onDblClickRow: function (index, row) {

                }
            });

        });

        /*上传excel的窗口打开操作*/
        function uploadidalogonline() {
            $('#uploadonlineinfo').window('open').dialog('setTitle', '批量导入明细');
        }

        //上传文件
        $("#uploadBtn").click(uploadonline);

        function uploadonline() {
            // var add = '/excel/importExcel';
            var uploadFile = $("#uploadfile")[0].files[0];
            console.log(uploadFile);
            var formData = new FormData();
            formData.append("uploadFile", uploadFile);
            console.log(formData);
            // if ("undefined" != typeof(uploadFile) && uploadFile != null && uploadFile != "") {
            $.ajax({
                url: '/excel/importExcel?instance=' + "wuliao",
                type: 'POST',
                data: formData,
                async: false,
                cache: false,
                contentType: false, //不设置内容类型
                processData: false, //不处理数据
                success: function (data) {
                    // alert(data);
                    if (data > 0) {
                        $.messager.alert('操作结果', '导入数据成功');
                        $("#booten").linkbutton('enable');
                        $('#uploadonlineinfo').dialog('close');
                        $('#dg').datagrid('reload');
                    } else {
                        $.messager.alert('操作结果', '导入数据失败');
                        $('#uploadonlineinfo').dialog('close');
                    }
                }
            })
        }

        //单价format
        function formatDanjia(val, row) {
            if (row != null && val) {
                return parseFloat(val).toFixed(2) + "元";
            }
        }

        function formatZongjia(val, row) {
            if (row != null && val) {
                return parseFloat(val).toFixed(2) + "元";
            }
        }

        function searchProj() {
            $("#projNameList").datagrid('load', {
                "xiangmumingcheng": $("#projSearch").val()
            });
        }
    </script>
</head>
<body class="easyui-layout">
<div region="north" style="height: 163px;padding: 10px;border: 0px;padding-top: 20px">
    <fieldset style="border-color: #E7F0FF">
        <legend>验收单号：<span id="dh"></span></legend>
        <form id="fm6" method="post">
            <table cellspacing="8px">
                <tr>
                    <td>
                        <!--供应商：<select class="easyui-combobox"  id="supplierId" name="supplier.id" style="width: 200px;" required=true data-options="required:true,panelHeight:'auto',valueField:'id',textField:'name',url:'/admin/supplier/comboList'"></select>-->
                        项目选择：<input type="text" id="projName" name="xiangmumingcheng" style="width: 90px;"
                                    class="easyui-validatebox"
                                    readonly="readonly" onclick="openProjListChoose()" required="true"/>
                        <input type="hidden" id="projId"/>
                    </td>
                    <td>
                        <!--供应商：<select class="easyui-combobox"  id="supplierId" name="supplier.id" style="width: 200px;" required=true data-options="required:true,panelHeight:'auto',valueField:'id',textField:'name',url:'/admin/supplier/comboList'"></select>-->
                        &nbsp;&nbsp;&nbsp;&nbsp;发料单位：<input type="text" id="deptName" name="faliaodanwei" size="10"
                                                            readonly="readonly" onclick="openDeptListChoose()"
                                                            class="easyui-validatebox" required="true"/>
                        <input type="hidden" id="deptId"/>
                    </td>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;入库库房：<input type="text" id="storeName" name="rukukufang" size="10"
                                                            readonly="readonly" onclick="openStoreListChoose()"
                                                            class="easyui-validatebox" required="true"/>
                        <input type="hidden" id="storeId"/>
                        &nbsp;&nbsp;&nbsp;&nbsp;摘要：<input type="text" id="zhaiyao" name="zhaiyao" size="10"
                                                          class="easyui-validatebox"/>
                    </td>


                    <!--创建人使用HttpSession中的当前用户-->
                    <!--<td>-->
                    <!--&nbsp;&nbsp;&nbsp;&nbsp;创建人：<input type="text" id="founder"  name="founder" size="10" class="easyui-validatebox" />-->
                    <!--</td>-->
                </tr>
                <tr>
                    <td>
                        承运车号：<input type="text" id="chengyunchehao" name="chengyunchehao" size="10"
                                    class="easyui-validatebox"/>
                    </td>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;运单号：<input type="text" id="yundanhao" name="yundanhao" size="15"
                                                           class="easyui-validatebox"/>
                    </td>
                    <td>
                        &nbsp;&nbsp;&nbsp;到货日期：
                        <input id="daohuoshijian" name="daohuoshijian" class="easyui-datebox" editable=false
                               style="width:100px">
                        &nbsp;&nbsp;&nbsp;验收日期&nbsp;
                        <input id="yanshouriqi" name="yanshouriqi" class="easyui-datebox" editable=false
                               style="width:100px">
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：<input type="text" size="58" id="beizhu_ys" name="beizhu" />
                    </td>

                    <!-- -->
                    <td>
                        <input type="hidden" id="wuliaoyanshoudanhao" name="wuliaoyanshoudanhao"/>
                        <input type="hidden" id="wuliaoYanshouDetailsJson" name="wuliaoYanshouDetailsJson"/>
                        &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:saveYanshouDan()" class="easyui-linkbutton"
                                                   iconCls="icon-ok">保存</a>
                    </td>
                    <td>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:getDaoHuoData()" class="easyui-linkbutton"
                                                   iconCls="icon-ok">关联到货单</a>
                    </td>
                    </td>
                </tr>
            </table>
        </form>
    </fieldset>
</div>
<!--dg显示的是物料验收单的详细,也就是在下方添加验收单详细时的数据.-->
<div region="center" style="padding: 10px;border: 1px">
    <table id="dg" class="easyui-datagrid" style="height: 1200px"
           fitColumns="true" rownumbers="true" singleSelect="true"
           fit="true" toolbar="#tb">
        <thead>
        <tr>
            <th field="id" width="30" align="center" sortable="true" hidden="hidden">编号</th>
            <th field="duiyingdaohuodanhao" width="130" align="center" sortable="true">对应到货单号</th>
            <th field="wuliaobianma" width="70" align="center" sortable="true">物料编码</th>
            <th field="mingchengguige" width="80" align="center" sortable="true">名称规格</th>
            <th field="danwei" width="50" align="center" sortable="true">单位</th>
            <th field="yingshoushuliang" width="40" align="center" sortable="true">应收数量</th>
            <th field="shishoushuliang" width="40" align="center" sortable="true" editor="numberbox">实收数量</th>
            <th field="danjia" width="50" align="center" sortable="true" formatter="formatDanjia">单价</th>
            <th field="zongjia" width="50" align="center" sortable="true" formatter="formatZongjia">总价</th>
            <th field="beizhu" width="50" align="center" sortable="true">备注</th>
            <!--<th field="createtime" width="70" align="center" sortable="true">创建时间</th>-->
            <th field="zongzhangid" width="50" align="center" sortable="true" hidden="hidden">总表id</th>
        </tr>
        </thead>
    </table>
    <div id="tb">
        <div style="padding: 2px">
            <!--<a href="javascript:openYanshouDetailsAddDialog()" class="easyui-linkbutton" iconCls="icon-add"-->
            <!--plain="true">添加</a>-->
            <a href="javascript:openYanshouDetailsModifyDialog()" class="easyui-linkbutton" iconCls="icon-edit"
               plain="true">修改</a>
            <a href="javascript:deleteYanshouDetails()" class="easyui-linkbutton" iconCls="icon-remove"
               plain="true">删除</a>
            <!--<a href="javascript:addGoodsDetailList()" class="easyui-linkbutton" iconCls="icon-add" plain="true">明细导入</a>-->
            <!--<a href="javascript:bangShenGouId()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">绑定申购单</a>-->
        </div>
    </div>
</div>

<!--查询项目列表-->
<div id="projList" class="easyui-dialog" style="width:800px;height:460px;"
     closed="true" data-options="onClose:function(){$('#s_codeOrProjName').val('');}">
    <div class="easyui-layout" style="width:100%;height:100%;">

        <div region="north" style="height: 50px;">
            <div style="padding-top: 8px;padding-left: 40px;">
                &nbsp;项目名称：&nbsp;<input type="text" id="projSearch" size="30"
                                              onkeydown="if(event.keyCode==13) searchProj()"/>
                <a href="javascript:searchProj()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
            </div>
        </div>
        <div region="west" style="width: 200px" title="项目分类" split="true" data-options="collapsible:false">
            <div style="overflow-x: auto; overflow-y: auto; height: 90%; width:98%;">
                <ul id="projTree" class="easyui-tree" style="padding: 10px"></ul>
            </div>
            <div style="position:absolute;bottom: 10px;left: 15px">
                <a href="javascript:saveProjChoose(1)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">选择</a>
                <!--<a id="del" href="javascript:deleteGoodsType()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',disabled:true">删除</a>-->
            </div>
        </div>
        <div region="center">
            <table id="projNameList" title="项目列表" class="easyui-datagrid"
                   fitColumns="true" pagination="true" rownumbers="true" singleSelect="true"
                   url="/admin/dproject/getSelective" fit="true" toolbar="#tb4">
                <thead>
                <tr>
                    <th field="id" width="30" hidden=true align="center">编号</th>
                    <th field="xiangmumingcheng" width="150" align="center">项目名称</th>
                    <th field="createtime" width="90" align="left">创建时间</th>
                </tr>
                </thead>
            </table>
            <div id="tb4">
                <div>
                    <a href="javascript:saveProjChoose(2)" class="easyui-linkbutton" iconCls="icon-ok"
                       plain="true">选择</a>
                </div>
            </div>
        </div>
    </div>
</div>

<!--查询部门列表-->
<div id="deptList" class="easyui-dialog" style="width:800px;height:460px;"
     closed="true" data-options="onClose:function(){$('#s_codeOrDeptName').val('');}">
    <div class="easyui-layout" style="width:100%;height:100%;">

        <div region="north" style="height: 50px;">
            <div style="padding-top: 8px;padding-left: 40px;">
                &nbsp;部门名称：&nbsp;<input type="text" id="deptSearch" size="30"
                                              onkeydown="if(event.keyCode==13) searchDept()"/>
                <a href="javascript:searchDept()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
            </div>
        </div>
        <div region="west" style="width: 200px" title="发料单位分类" split="true" data-options="collapsible:false">
            <div style="overflow-x: auto; overflow-y: auto; height: 90%; width:98%;">
                <ul id="deptTree" class="easyui-tree" style="padding: 10px"></ul>
            </div>
            <div style="position:absolute;bottom: 10px;left: 15px">
                <a href="javascript:saveDeptChoose(1)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">选择</a>
                <!--<a id="del" href="javascript:deleteGoodsType()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',disabled:true">删除</a>-->
            </div>
        </div>
        <div region="center">
            <table id="deptNameList" title="发料单位列表" class="easyui-datagrid"
                   fitColumns="true" pagination="true" rownumbers="true" singleSelect="true"
                   url="/admin/dbumen/getSelective" fit="true" toolbar="#tb-bm">
                <thead>
                <tr>
                    <th field="id" width="30" hidden=true align="center">编号</th>
                    <th field="bumenmingcheng" width="150" align="center">单位名称</th>
                    <th field="createtime" width="90" align="left">创建时间</th>
                </tr>
                </thead>
            </table>
            <div id="tb-bm">
                <div>
                    <a href="javascript:saveDeptChoose(2)" class="easyui-linkbutton" iconCls="icon-ok"
                       plain="true">选择</a>
                </div>
            </div>
        </div>
    </div>
</div>

<!--查询仓库列表-->
<div id="storeList" class="easyui-dialog" style="width:800px;height:460px;"
     closed="true" data-options="onClose:function(){$('#s_codeOrStoreName').val('');}">
    <div class="easyui-layout" style="width:100%;height:100%;">

        <div region="north" style="height: 50px;">
            <div style="padding-top: 8px;padding-left: 40px;">
                &nbsp;仓库名称或者仓库编号：&nbsp;<input type="text" id="storeSearch" size="30"
                                              onkeydown="if(event.keyCode==13) searchStore()"/>
                <a href="javascript:searchStore()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
            </div>
        </div>
        <div region="west" style="width: 200px" title="仓库列表" split="true" data-options="collapsible:false">
            <div style="overflow-x: auto; overflow-y: auto; height: 90%; width:98%;">
                <ul id="storeTree" class="easyui-tree" style="padding: 10px"></ul>
            </div>
            <div style="position:absolute;bottom: 10px;left: 15px">
                <a href="javascript:saveStoreChoose()" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">选择</a>
                <!--<a id="del" href="javascript:deleteGoodsType()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',disabled:true">删除</a>-->
            </div>
        </div>
        <div region="center">
            <table id="storeNameList" title="仓库选择" class="easyui-datagrid"
                   fitColumns="true" pagination="true" rownumbers="true" singleSelect="true"
                   url="/admin/dkufang/getSelective" fit="true" toolbar="#tb5">
                <thead>
                <tr>
                    <th field="id" width="30" hidden=true align="center">编号</th>
                    <th field="kufangmingcheng" width="50" align="center">仓库名称</th>
                    <th field="createtime" width="150" align="left">创建时间</th>
                </tr>
                </thead>
            </table>
            <div id="tb5">
                <div>
                    <a href="javascript:saveStoreChoose()" class="easyui-linkbutton" iconCls="icon-ok"
                       plain="true">选择</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!--选择物料时的弹出窗-->
<div id="dlg" class="easyui-dialog" style="width:800px;height:460px;"
     closed="true" data-options="onClose:function(){$('#s_codeOrName').val('');}">
    <div class="easyui-layout" style="width:100%;height:100%;">

        <div region="north" style="height: 50px;">
            <div style="padding-top: 8px;padding-left: 40px;">
                &nbsp;物料编码或者名称规格：&nbsp;<input type="text" id="s_codeOrName" size="30"
                                              onkeydown="if(event.keyCode==13) searchGoods()"/>
                <a href="javascript:searchGoods()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
            </div>
        </div>
        <div region="west" style="width: 200px" title="物料类别" split="true" data-options="collapsible:false">
            <div style="overflow-x: auto; overflow-y: auto; height: 90%; width:98%;">
                <ul id="tree" class="easyui-tree" style="padding: 10px"></ul>
            </div>
        </div>
        <div region="center">
            <table id="dg3" title="物料列表" class="easyui-datagrid"
                   fitColumns="true" pagination="true" rownumbers="true" singleSelect="true"
                   url="/admin/dwuliao/getSelective" fit="true" toolbar="#tb3">
                <thead>
                <tr>
                    <th field="id" width="30" align="center" sortable="true">编号</th>
                    <th field="dalei" width="65" align="center" sortable="true">大类</th>
                    <th field="wuliaobianma" width="80" align="center" sortable="true">物料编码</th>
                    <th field="mingchengguige" width="100" align="center" sortable="true">名称规格</th>
                    <th field="danwei" width="50" align="center" sortable="true">单位</th>
                    <th field="kehuishou" width="50" align="center" sortable="true">可回收</th>
                    <th field="huishouxiang" width="50" align="center" sortable="true">回收项</th>
                    <th field="beizhu" width="100" align="center" sortable="true">备注</th>
                    <th field="founder" width="60" align="center" sortable="true">创建人</th>
                    <th field="createtime" width="70" align="center" sortable="true">创建时间</th>
                </tr>
                </thead>
            </table>
            <div id="tb3">
                <div>
                    <a href="javascript:openGoodsChooseDialog()" class="easyui-linkbutton" iconCls="icon-ok"
                       plain="true">选择</a>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="dlg2" class="easyui-dialog" style="width:300px;height:120px;padding: 10px 20px"
     closed="true" buttons="	#dlg-buttons2" data-options="onClose:function(){$('#goodsTypeName').val('');}">

    <form id="fm" method="post">
        <div>
            物料类别：&nbsp;<input type="text" id="goodsTypeName" name="name" class="easyui-validatebox" required="true"/>
        </div>
    </form>
</div>

<div id="dlg-buttons2">
    <a href="javascript:saveGoodsType()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
    <a href="javascript:closeGoodsTypeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>

<div id="dlg4" class="easyui-dialog" style="width:550px;height:465px;padding: 5px 5px"
     closed="true" buttons="#dlg-buttons4" data-options="onClose:function(){resetValue()}">

    <fieldset style="border-color: #E7F0FF">
        <legend>物料信息</legend>
        <form id="fm4" method="post">
            <table cellspacing="8px">
                <tr>
                    <td width="60">物料编码：</td>
                    <td><input type="text" id="wuliaobianma" name="wuliaobianma" size="10" readonly="readonly"/></td>
                </tr>
                <tr>
                    <td width="80">名称规格：</td>
                    <td><input type="text" id="mingchengguige" name="mingchengguige" size="10" readonly="readonly"/>
                    </td>

                </tr>
                <tr>
                    <td width="80">应收数量：</td>
                    <td><input type="text" id="yingshoushuliang" name="yingshoushuliang" size="10"
                               class="easyui-numberbox" required="required"
                               readonly="readonly"/></td>
                    <td width="80">物料单位：</td>
                    <td><input type="text" id="danwei" name="danwei" size="10" readonly="readonly"/></td>
                </tr>
                <tr>
                    <td width="80">备注</td>
                    <td><input type="text" id="beizhu_dh" name="beizhu" size="10" readonly="readonly"/></td>
                </tr>

            </table>
        </form>
    </fieldset>
    <div style="padding-left: 12px;padding-top: 10px">
        <form id="fm5" method="post">
            <table cellspacing="8px">
                <tr></tr>
                <br>
                <tr>
                    <td>实收数量：</td>
                    <td><input type="text" id="shishoushuliang" name="shishoushuliang" class="easyui-numberbox"
                               data-options="min:1"
                               required="true" size="10"/></td>
                </tr>
                <tr>
                    <td>单价：</td>
                    <td>
                        <input type="hidden" id="action"/>
                        <input type="hidden" id="rowIndex"/>
                        <input type="text" id="danjia" name="danjia" class="easyui-numberbox"
                               data-options="min:0,precision:2" size="10"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>

<div id="dlg-buttons4">
    <a id="saveAndAddNextBuuton" href="javascript:saveGoods(2)" class="easyui-linkbutton"
       iconCls="icon-ok">保存并新增下一物料</a>
    <a href="javascript:saveGoods(1)" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
    <a href="javascript:closeGoodsChooseDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>


<!--选择关联到货单时的弹出窗-->
<div id="daohuodan" class="easyui-dialog" style="width:700px;height:460px;"
     closed="true" data-options="onClose:function(){$('#s_codeOrName').val('');}">
    <div class="easyui-layout" style="width:100%;height:100%;">

        <div region="north" style="height: 70px;">
            <div style="padding-top: 8px;padding-left: 40px;">
                &nbsp;到货单号：&nbsp;<input type="text" id="dh_danhao" size="20"
                                        onkeydown="if(event.keyCode==13) searchBindDaohuoDan()"/>
                &nbsp;项目名称：&nbsp;<input type="text" id="dh_xiangmuming" size="20"
                                        onkeydown="if(event.keyCode==13) searchBindDaohuoDan()"/>
                <br>
                &nbsp;库房名称：&nbsp;<input type="text" id="dh_kufang" size="20"
                                        onkeydown="if(event.keyCode==13) searchBindDaohuoDan()"/>
                &nbsp;到货备注：&nbsp;<input type="text" id="dh_beizhu" size="20"
                                        onkeydown="if(event.keyCode==13) searchBindDaohuoDan()"/>
                &nbsp; &nbsp;
                <a href="javascript:searchBindDaohuoDan()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
            </div>
        </div>
        <div region="center">
            <!--到货单多选,选定选择,展示到dg的datagrid-->
            <table id="daohuoList" title="到货单列表" class="easyui-datagrid"
                   fitColumns="true" pagination="true" rownumbers="true"
                   url="/admin/daohuodan/getSelective" fit="true"><!--toolbar="#tb6"-->
                <thead>
                <tr>
                    <th field="ukyo" align="center" width="30" checkbox="true"></th>
                    <th field="id" width="45" align="center" sortable="true">编号</th>
                    <th field="wuliaodaohuodanhao" width="100" align="center" sortable="true">单号</th>
                    <th field="xiangmumingcheng" width="100" align="center" sortable="true">项目名称</th>
                    <th field="rukukufang" width="50" align="center" sortable="true">库房名称</th>
                    <th field="beizhu" width="50" align="center" sortable="true">备注</th>
                    <th field="createtime" width="80" align="center" sortable="true">创建时间</th>
                </tr>
                </thead>
            </table>
            <!--<div id="tb6">-->
            <!--<div>-->
            <!--<a href="javascript:openGoodsChooseDialog()" class="easyui-linkbutton" iconCls="icon-ok"-->
            <!--plain="true">选择</a>-->
            <!--</div>-->
            <!--</div>-->
        </div>
    </div>
</div>


<!--上传excel的弹出窗-->
<div id="uploadonlineinfo" class="easyui-window" style="width:380px;padding:10px 40px" closed="true">

    <form id="fam" method="post" enctype="multipart/form-data">

        <!--<input class="easyui-filebox" id="onlinefilename" name="onlinefilename" data-options="prompt:'文件上传'"-->
        <!--style="width:100%" />-->
        <input type="file"
               id="uploadfile" name="uploadfile" style="width:100%"/>
    </form>

    <br>

    <div data-options="region:'south',border:false" style="text-align:center;padding:5px 0 0;">
        <button id="uploadBtn" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
                style="width:80px">上传
        </button>
    </div>
    <br>
    <p style="text-align: center"><a href="/xlsx/yangji.xlsx">下载阳极excel模板</a></p>

</div>

<!--大屏幕上右键datagrid dlg-->
<div id="grid-data" class="easyui-menu" style="width: 80px; display: none;">
    <div id="grid-data-edit" href="javascript:openYanshouDetailsModifyDialog()" data-options="iconCls:'icon-edit'">修改
    </div>
    <div id="grid-data-delete" href="javascript:deleteYanshouDetails()" data-options="iconCls:'icon-remove'"
         plain="true">删除
    </div>
</div>
<!--二级菜单右键弹出-->
<div id="tree-2" class="easyui-menu" style="width: 80px; display: none;">
    <!--<div id="tree-2-delete" href="javascript:deleteType()" data-options="iconCls:'icon-remove'">删除二级菜单</div>-->
</div>
<!--一级菜单右键弹出-->
<div id="tree-1" class="easyui-menu" style="width: 80px; display: none;">
    <!--<div id="tree-1-add-2" href="javascript:openTypeAddDialog()" data-options="iconCls:'icon-add'">添加二级菜单</div>-->
    <!--<div id="tree-1-delete" href="javascript:deleteType()" data-options="iconCls:'icon-remove'">删除一级菜单</div>-->
</div>
<!--树形菜单右键弹出-->
<div id="tree-0" class="easyui-menu" style="width: 80px; display: none;">
    <!--<div id="tree-0-add-1" href="javascript:openTypeAddDialog(0)" data-options="iconCls:'icon-add'">添加一级菜单</div>-->
    <!--<div id="tree-0-refresh" href="javascript:reloadTree()" data-options="iconCls:'icon-reload'">重新加载类别</div>-->
</div>

</body>
</html>